package com.beasts.ant.page.service;

import com.beasts.ant.page.entity.APGroupPage;
import com.beasts.ant.page.repository.InitDataRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Example;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author cn_zkn
 * @date 20/04/2018 11:02 AM
 * @since 1.0
 */
@Service
public class InitDataServiceImpl implements IInitDataService {

    @Autowired
    private InitDataRepository initDataRepository;

    @Override
    public List<APGroupPage> findAll() {
        return initDataRepository.findAll();
    }

    @Override
    public List<APGroupPage> findByPageType(HttpServletRequest req) {

        String pageType = req.getParameter("pageType");
        return initDataRepository.findByPageTypeOrderByPageOrderAsc(pageType);
    }

    @Override
    public List<APGroupPage> findAll(Example<APGroupPage> example) {
        return null;
    }


}
